<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>15-清除浮动-双伪元素清除法</title>
  <style>



    .clearfix:after, .clearfix:before {
      /* 前与后: 混合双打 */
      content: "";
      display: table;
    }

    .clearfix:after {
      clear: both;
    }

    .clearfix {
      /* IE6、7 专有 */
      *zoom: 1;
    }
    
    .box {

      width: 900px;
      background-color: pink;
      margin: 0 auto;
    }

    .box .damao {
      float: left;
      width: 200px;
      height: 200px;
      background-color: khaki;
    }

    .box .ermao {
      float: left;
      width: 200px;
      height: 200px;
      background-color: purple;
    }

    .footer {
      height: 100px;
      background: sienna;
      margin-top: 100px;
    }
  </style>
</head>

<body>

  <div class="box clearfix">
    <div class="damao">大毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
    <div class="ermao">二毛</div>
  </div>

  <div class="footer"></div>

</body>

</html>